package boerse.main.CommandProcessor;

import boerse.CommandProcessor.CommandTypeInfo;

public enum StockGameCommandType implements CommandTypeInfo {
	HELP ("help", "", " * list all Commands"),
	EXIT ("exit", "", "exit the Programm"),
	CREATEPLAYER ("crp",  "createPlayer","<playername> * create new player by playername", String.class),
	BUYSHARE ("bus", "buyShare", "<playerName> <shareName> <count> * buy that ammount of shares", String.class, String.class, int.class),
	SELLSHARE ("sll", "sellShare", "<playerName> <shareName> <count> * sell that ammount of shares", String.class, String.class, int.class),
	ADDMONEY ("adm", "addMoney", "<playerName> <money> * add money to the account", String.class, int.class),
	GETCASHACCOUNTPRICE ("cap" , "getCashAccountPrice", "<playerName> * print his ammount of cash", String.class),
	GETSHAREDEPOSITPRICE("sdp", "getShareDepositPrice", "<playerName> * print his asset of his share depo", String.class),
	GETALLASSETS("aa", "getAllAssets", "<playerName> * print all of his Asset (share depo, account)", String.class) ,
    SHOWTICKER("st", "showTicker", "* shows a ticker with all asset values"),
    DRAWGRAPH ("dg", "drawGraph", "<shareName> * draws a graph for the share", String.class)
	;
	
	private String cmdName;
	private String methodName;
	private String helpText;
	private Class<?>[] paramType;
	
	private StockGameCommandType(String cmdName, String methodName, String helpText) {	
		this.methodName = methodName;
		this.cmdName = cmdName;
		this.helpText = helpText;
	}
	
	
	private StockGameCommandType(String cmdName, String methodName, String helpText, Class<?> param) {
		this.methodName = methodName;
		this.cmdName = cmdName;
		this.helpText = helpText;
		this.paramType = new Class<?>[1];
		this.paramType[0] = param;
	}
	
	
	private StockGameCommandType(String cmdName, String methodName, String helpText, Class<?> param1,
			Class<?> param2) {
		this.methodName = methodName;
		this.cmdName = cmdName;
		this.helpText = helpText;
		this.paramType = new Class<?>[2];
		this.paramType[0] = param1;
		this.paramType[1] = param2;
	}


	private StockGameCommandType(String cmdName, String methodName ,String helpText, Class<?> param1,
			Class<?> param2, Class<?> param3) {
		this.methodName = methodName;
		this.cmdName = cmdName;
		this.helpText = helpText;
		this.paramType = new Class<?>[3];
		this.paramType[0] = param1;
		this.paramType[1] = param2;
		this.paramType[2] = param3;
	}


	public String getCmdName() {
		return cmdName;
	}

	public String getHelpText() {
		return helpText;
	}
	
	public String getMethodName() {
		return methodName;
	}

	public Class<?>[] getParamTypes() {
		return paramType;	
	}
	
}
